//
//  MTBeautifySetView.m
//  MeToo
//
//  Created by 俊松何 on 2018/9/26.
//  Copyright © 2018年 tianxie. All rights reserved.
//

#import "MTBeautifySetView.h"

@interface MTBeautifySetView()

@property(nonatomic,weak) KLCPopup *pop;

@property (weak, nonatomic) IBOutlet UISlider *beatufiySilder;
@property (weak, nonatomic) IBOutlet UISlider *whiteSilder;
@property (weak, nonatomic) IBOutlet UISlider *redSilder;


@end

@implementation MTBeautifySetView

-(void)awakeFromNib
{
    [super awakeFromNib];
    self.beatufiySilder.value = 1;
    self.whiteSilder.value = 1;
    self.redSilder.value = 0;
    
}

+(instancetype)beautifySetView
{
    MTBeautifySetView *view  = [[NSBundle mainBundle] loadNibNamed:@"MTBeautifySetView" owner:nil options:nil].lastObject;
    view.frame = CGRectMake(0, 0, WIDTH, 178);
    return view;
}

-(void)show
{
    KLCPopup *newpop = [KLCPopup popupWithContentView:self];
    newpop.showType = KLCPopupShowTypeSlideInFromBottom;
    newpop.dismissType = KLCPopupDismissTypeSlideOutToBottom;
    newpop.maskType = KLCPopupMaskTypeNone;
    self.pop = newpop;
    [newpop showAtCenter:CGPointMake(WIDTH/2.0, HEIGHT - self.frame.size.height/2) inView:[[UIApplication sharedApplication].delegate window]];
}


- (IBAction)beatufiyClick:(UISlider *)sender {
    
    if(self.delegate && [self.delegate respondsToSelector:@selector(beautify:Red:white:)])
    {
        [self.delegate beautify:self.beatufiySilder.value Red:self.redSilder.value white:self.whiteSilder.value];
    }
}
- (IBAction)whiteClick:(UISlider *)sender {
    if(self.delegate && [self.delegate respondsToSelector:@selector(beautify:Red:white:)])
    {
        [self.delegate beautify:self.beatufiySilder.value Red:self.redSilder.value white:self.whiteSilder.value];
    }
    
}
- (IBAction)redClick:(UISlider *)sender {
    if(self.delegate && [self.delegate respondsToSelector:@selector(beautify:Red:white:)])
    {
        [self.delegate beautify:self.beatufiySilder.value Red:self.redSilder.value white:self.whiteSilder.value];
    }
}


@end
